package com.edu.marker.task;

import java.util.List;
import java.util.concurrent.RejectedExecutionException;

import org.apache.http.message.BasicNameValuePair;

import com.edu.marker.task.WSTask.TaskListener;

import android.content.Context;

public class WSAPI {
	public static final String SERVER_URL = "";
	
	public static void doRequest(Context context, TaskListener listener, 
			List<BasicNameValuePair> vp, int action) {
		try {
			new WSTask(context, listener, vp, action).execute();
		} catch (RejectedExecutionException e) {
			// do nothing, just keep not crashing...
		}
	}
	
	public static interface WSACTION {
//		public static final int ACT_REGISTER = 0;
		public static final int ACT_LOGIN = 1;
		public static final int ACT_PAPER = 2;
		public static final int ACT_QUSTIONTITLE = 3;
		public static final int ACT_QUSTIONPICINFO = 4;
		public static final int ACT_QUSTIONPIC = 5;
//		public static final int ACT_SYNC = 6;
//		public static final int ACT_LOGOUT= 7;
	}
	
	public static interface WSRESULT {
		public static final String REGISTER_OK = "1000";
		public static final String REGISTER_NR = "1001"; //name repeat
		
		public static final String LOGIN_OK = "true"; 
		public static final String LOGIN_NS = "false"; //not successful
		
		public static final String LOGOUT_OK = LOGIN_OK; 
		public static final String LOGOUT_NS = LOGIN_NS; //not successful
	}
}
